package com.lottery.ruok.lottrey.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.lottery.ruok.lottrey.R;
import com.lottery.ruok.lottrey.retrofitModule.RetrofitBase;
import com.lottery.ruok.lottrey.retrofitModule.RxHelper;
import com.lottery.ruok.lottrey.retrofitModule.RxSubscribe;
import com.lottery.ruok.lottrey.retrofitModule.request.LimitRemarkRequest;
import com.lottery.ruok.lottrey.retrofitModule.response.LimitRemarkResponse;
import com.lottery.ruok.lottrey.userInfo.UserInfo;

import butterknife.BindView;
import butterknife.ButterKnife;

/*
* 限额说明
* */

public class LimitRemarkActivity extends BaseActivity {

    @BindView(R.id.content)
    TextView content;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_limit_remark);
        ButterKnife.bind(this);

        init();
    }

    private void init() {
        RetrofitBase.getRetrofit().create(LimitRemarkRequest.class).getResult(UserInfo.getToken())
                .compose(RxHelper.<LimitRemarkResponse>handleResult())
                .subscribe(new RxSubscribe<LimitRemarkResponse>(this) {
                    @Override
                    protected void _onNext(LimitRemarkResponse limitRemarkResponse) {
                        content.setText(limitRemarkResponse.getValue());
                    }

                    @Override
                    protected boolean showDialog() {
                        return false;
                    }
                });
    }
}
